package cn.bs.busuo.account.dao.persist.repository.impl;

import cn.bs.busuo.account.dao.persist.mapper.CityMapper;
import cn.bs.busuo.account.dao.persist.repository.ICityRepository;
import cn.bs.busuo.account.pojo.entity.CitySights;
import cn.bs.busuo.account.pojo.vo.CitiesVO;
import cn.bs.busuo.account.pojo.vo.SightListVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class CityRepositoryImpl implements ICityRepository {
    @Autowired
    private CityMapper cityMapper;

    @Override
    public void insert(CitySights citySights) {
        cityMapper.insert(citySights);
    }

    //根据id查询城市信息
    @Override
    public CitiesVO selectById(Long id) {
        return cityMapper.selectById(id);
    }

    //根据城市id查询景点列表
    @Override
    public List<SightListVO> selectList(Long id) {
        List<SightListVO> sightListVOS = cityMapper.selectList(id);
        return sightListVOS;
    }
}
